/*
 *  $Id: SwornEnemy.cs 906 2009-11-29 12:07:32Z thenn.erannor $
 *	This file is a part of Ragima CCG.
 *	(C) 2008 Ragima development group.
 *
 *	Licensed under the terms of the GNU GPL License version 2.
 *
 */

namespace Ragima.Cards001.Neutral.Abilities {
    public class SwornEnemy: AbilityCard<Creature> {
        public int AttackBonus;

        public SwornEnemy(): base("001_n_a_sworn_enemy") {
            Level = CompleteLevel.ReadyForTest;
            Element = ElementType.Neutral;
            Target = CreatureTarget.Enemy;
            TapCreatureAfterUse = false;
            AttackBonus = 0;
        }

        public SwornEnemy(int bonus): this() {
            SetPictureSource<SwornEnemy>();
            AttackBonus = bonus;
        }

        private static readonly Languages.CardPhrase<SwornEnemy> Action = new Languages.CardPhrase<SwornEnemy>("action");

        protected override void DoAction(TargetArgs<Creature> args) {
            args.Caster.RemoveAffect<Affects.SwornEnemy>();
            args.Player.Game.Log.Add(Action.Phrase, args.Caster, args.Target.Race);
            args.Caster.AddAffect(new Affects.SwornEnemy(args.Target.Race, AttackBonus));
        }
    }
}
